package guoanmaker.operator.business.controller;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import guoanmaker.operator.business.model.InRoundPhone;
import guoanmaker.operator.business.model.OperatorPcActive;
import guoanmaker.operator.business.model.OperatorPcCompanyDevelop;
import guoanmaker.operator.business.service.OperatorPcActiveServiceInterface;
import guoanmaker.operator.business.service.OperatorPcCompanyDevelopServiceInterface;
import guoanmaker.operator.helper.common.AjaxJson;
import guoanmaker.operator.helper.common.abstractobj.ApiController;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(ApiController.OPERATOR_PC_COMPANY_DEVELOP)
public class OperatorPcCompanyDevelopController {
	@Autowired
	private OperatorPcCompanyDevelopServiceInterface operatorPcCompanyDevelopServiceInterface;
	 @ApiOperation(value = "保存企业发展", notes = "新增/修改企业发展")
	    @PostMapping(value = "saveOperatorPcCompanyDevelop")
	    public AjaxJson saveOperatorPcCompanyDevelop(@RequestBody InRoundPhone inRoundPhone) {
		 AjaxJson ajaxJson=new AjaxJson();
		 try{
	    		operatorPcCompanyDevelopServiceInterface.saveOperatorPcCompanyDevelop(inRoundPhone);
	    	
	    	
	    	ajaxJson.setSuccess(true).setStatus(200).setData(null);
	    	}catch(Exception e){
	    		e.printStackTrace();
	    		ajaxJson.setSuccess(false).setStatus(250).setData(null);
	    	}
	    	
	        return ajaxJson;
	    }
	 /**
	  * 运营后台调用 
	 * @Title: selectOperatorPcCompanyDevelopList 
	 * @Description: TODO(这里用一句话描述这个方法的作用) 
	 * @param cityId
	 * @return    设定文件 
	 * @return AjaxJson    返回类型 
	 * @throws 
	  */
	 @ApiOperation(value = "查询企业发展", notes = "查询企业发展")
	    @PostMapping(value = "selectOperatorPcCompanyDevelopList")
	 public AjaxJson  selectOperatorPcCompanyDevelopList(String cityId){
		 AjaxJson ajaxJson=new AjaxJson();
		 try{
			 Map pds=operatorPcCompanyDevelopServiceInterface.selectOperatorPcCompanyDevelops(cityId);
	    	
	    	
	    	ajaxJson.setSuccess(true).setStatus(200).setData(pds);
	    	}catch(Exception e){
	    		e.printStackTrace();
	    		ajaxJson.setSuccess(false).setStatus(250).setData(null);
	    	}
		 return ajaxJson;
		 
	 }
	 
	 /**
	  * 官网调用
	 * @Title: selectOperatorPcCompanyDevelopListTv 
	 * @Description: TODO(这里用一句话描述这个方法的作用) 
	 * @param cityId
	 * @return    设定文件 
	 * @return AjaxJson    返回类型 
	 * @throws 
	  */
	 @ApiOperation(value = "查询企业发展", notes = "改查询企业发展")
	    @PostMapping(value = "selectOperatorPcCompanyDevelopListTv")
	 public AjaxJson  selectOperatorPcCompanyDevelopListTv(String cityId){
		 AjaxJson ajaxJson=new AjaxJson();
		 try{
			 List<OperatorPcCompanyDevelop> pds=operatorPcCompanyDevelopServiceInterface.selectOperatorPcCompanyDevelopsAndserverName(cityId);
	    	
	    	
	    	ajaxJson.setSuccess(true).setStatus(200).setData(pds);
	    	}catch(Exception e){
	    		e.printStackTrace();
	    		ajaxJson.setSuccess(false).setStatus(250).setData(null);
	    	}
		 return ajaxJson;
		 
	 }
	 
}
